home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / prog_c / cuj0896.zip / KREHBIEL.ZIP / VBE.H < prev   
Text File  |  1996-04-15  |  3KB  |  101 lines

  1. Listing 2:
  2. /*--------------------------------------------------------------
  3.   vbe.h           vbe.c exports and data types
  4. --------------------------------------------------------------*/
  5.  
  6. typedef struct
  7. {
  8.     char    VbeSignature[4];    /* "VESA" */
  9.     int        VbeVersion;            /* bcd */
  10.     char     far *OemStringPtr;    /* asciiz */
  11.     long     Capabilities;        /* of video, bitmapped */
  12.     int        far *VideoModePtr;    /* array of svga mode numbers */
  13.     int        TotalMemory;        /* video memory/64kb */
  14.     
  15.     /* vbe 2.0+ */
  16.     int        OemSoftwareRev;            /* bcd */
  17.     char    far *OemVendorNamePtr;    /* asciiz */
  18.     char    far *OemProductNamePtr;    /* asciiz */
  19.     char    far    *OemProductRevPtr;    /* asciiz */
  20.     char    Reserved[222];            /* used by vbe */
  21.     char    OemData[256];            /* used by vbe */
  22.     
  23. } VbeInfo_t;
  24.  
  25. typedef struct
  26. {
  27.     int        ModeAttributes;    /* bitmapped */
  28.     char    WinAAttributes;    /* bitmapped */
  29.     char    WinBAttributes;
  30.     int        WinGranularity;    /* in Kb */
  31.     int        WinSize;        /* in Kb */
  32.     int        WinASegment;    /* start segment */
  33.     int        WinBSegment;
  34.     void    far *WinFuncPtr;/* to window control function */
  35.     int        BytesPerScanLine;
  36.     
  37.     /* vbe 1.2+ */
  38.     int        XResolution;        /* in pixels or coloumns */
  39.     int        YResolution;        /* in pixels or rows */
  40.     char    XCharSize;            /* char cell width in pixels */
  41.     char    YCharSize;            /* char cell depth in pixels */
  42.     char    NumberOfPlanes;        /* memory planes */
  43.     char    BitsPerPixel;        /* color resolution */
  44.     char    NumberOfBanks;
  45.     char    MemoryModel;        /* values defined by vesa */
  46.     char    BankSize;            /* in Kb */
  47.     char    NumberOfImagePages;
  48.     char    Reserved1;            /* 1: for page function */
  49.     
  50.     /* direct color fields */
  51.     char    RedMaskSize;        /* size of dc mask in bits */
  52.     char    RedFieldPosition;    /* bit position of mask lsb */
  53.     char    GreenMaskSize;
  54.     char    GreenFieldPosition;
  55.     char    BlueMaskSize;
  56.     char    BlueFieldPosition;
  57.     char    RsvdMaskSize;
  58.     char    RsvdFieldPosition;
  59.     char    DirectColorModeInfo;/* bitmapped */
  60.     
  61.     /* vbe 2.0+ */
  62.     void    far *PhysBasePtr;        /* to flat frame buffer */
  63.     void    far *OffScreenMemOffset;/* to offscreen memory */
  64.     int        OffScreenMemSize;        /* in Kb */
  65.     char    Reserved2[206];
  66.  
  67. } ModeInfo_t;
  68.  
  69. int VbeGetVbeInfo(VbeInfo_t far *p)
  70.  
  71.     /* fetches the vbe info block; returns 0 if no vbe. */
  72. ;
  73. int VbeGetModeInfo(int mode,ModeInfo_t far *p)
  74.  
  75.     /* fetches the mode info block for the specified mode 
  76.     number;    returns 0 if mode unsupported by vbe. */
  77. ;
  78. int VbeSetMode(int mode)
  79.  
  80.     /* initializes the requested video mode; returns 0 if 
  81.     there's no vbe or the mode is unavailable. */
  82. ;
  83. void VbeSetPalette(const char far *p,int start,int n)
  84.  
  85.     /* loads the dac palette registers; uses bios on vbe 
  86.     versions before 2.0 */
  87. ;
  88. void VbeSetWindow(int window,int position)
  89.  
  90.     /* repositions the indicates memory window to the new
  91.     position (in WinGranularity units). */
  92. ;
  93. void VbeWrite(int x,int y,int bytes,const char far *buffer)
  94.  
  95.     /* copies the contents of the buffer (<64k) to display, 
  96.     starting at pixel (x,y). */
  97. ;
  98. /*--------------------------------------------------------------
  99.                               eof
  100. --------------------------------------------------------------*/
  101.